package com.ihr360.cnb.module.common.service;


import com.ihr360.cnb.module.common.service.fallback.ProgressServiceFallback;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 文件上传进程设置
 *
 * @author tom
 * @date 17-6-21
 */

@FeignClient(name = "irenshi-dubbo-provider", fallback = ProgressServiceFallback.class)
public interface ProgressService {

    @RequestMapping(value = "/progress/init", method = RequestMethod.POST)
    boolean initProgress(@RequestParam(value = "type") String type, @RequestParam(value = "sessionId") String sessionId,
                         @RequestParam(value = "progressId") String progressId);

    @RequestMapping(value = "/progress/set", method = RequestMethod.POST)
    boolean setProgress(@RequestParam(value = "type") String type, @RequestParam(value = "percent") int percent);

    @RequestMapping(value = "/progress/finish", method = RequestMethod.POST)
    boolean finish(@RequestParam(value = "type") String type);

}

